package com.usian.controller;

import com.usian.pojo.User;
import com.usian.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/user")
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/findById/{userId}")
    public User findById(@PathVariable Integer userId){
        return userService.fingById(userId);
    }

    public User findId(@RequestParam Integer userId){
        return userService.findId(userId);
    }

    @RequestMapping("/insert")
    public User insert(User user){
        return userService.insert(user);
    }
}
